From: Daniel Boles Date: Mon, 4 Sep 2017 22:41:53 +0000 (+0100) Subject: ComboBox: Don’t popdown if releasing on scrollbar X-Git-Tag: archive/raspbian/3.24.39-1+rpi1~1^2~65^2~39^2~211 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=99e27ab1455d917840032aa961aac8159a9937c7;p=gtk%2B3.0.git ComboBox: Don’t popdown if releasing on scrollbar On button release, we were popping down if the event widget was anything but priv->button. This broke scrolling by clicking a mouse button, i.e. when releasing a click in the trough or finishing a drag of either bar. That’s unexpected, inconvenient, and pointless. So, let’s stop doing it. https://bugzilla.gnome.org/show_bug.cgi?id=738893 --- diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 9acb1fbd5f..1755a1ed32 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -3160,16 +3160,21 @@ gtk_combo_box_list_button_released (GtkWidget *widget, if (ewidget != priv->tree_view) { + GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (priv->scrolled_window); + if (ewidget == priv->button && !popup_in_progress && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->button))) { gtk_combo_box_popdown (combo_box); + return TRUE; } - /* released outside treeview */ - if (ewidget != priv->button) + /* If released outside treeview, pop down, unless finishing a scroll */ + if (ewidget != priv->button && + ewidget != gtk_scrolled_window_get_hscrollbar (scrolled_window) && + ewidget != gtk_scrolled_window_get_vscrollbar (scrolled_window)) { gtk_combo_box_popdown (combo_box);